package cn.edu.ustc.xrovers.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table
public class CompanyRole {

	private Integer id;
	private String role;//公司角色
	private Set<Company> companys=new HashSet<Company>();
	
	@OneToMany(mappedBy="role",fetch=FetchType.EAGER)
	public Set<Company> getCompanys() {
		return companys;
	}
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getId() {
		return id;
	}
	@Column(name="CR_Role")
	public String getRole() {
		return role;
	}
	
	
	/*set方法*/
	public void setId(Integer id) {
		this.id = id;
	}
	public void setRole(String role) {
		this.role = role;
	}
	public void setCompanys(Set<Company> companys) {
		this.companys = companys;
	}
}
